import * as reduceTypes from '../action/Type';
let initState: initObject = {
    list: 11111,
    todos: [
        {
            id: 1,
            title: '学习React',
            isComplete: true
        },
        {
            id: 2,
            title: '学习Node',
            isComplete: false
        },
        {
            id: 3,
            title: '学习Hooks',
            isComplete: false
        }
    ]
};

function reducer(state: any = initState, action: any) {
    // console.log(action)
    switch(action.type) {
        case  reduceTypes.TOGGLE_COMPLETE: return {list: state.list + action.count}
    }
    return state
}

export default reducer;